<template>
    <div class="container">
        <div class="list" v-for="(item,index) in list" :key="index" @click="goPay(item)">
            <div class="list_s">
                <div class="list_container">
                    <div class="list_c">
                        <div class="list_name" v-if="item.range==0">全平台通用红包</div>
                        <div class="list_name" v-if="item.range==1">限本餐厅使用</div>
                        <div class="list_time">领取时间：{{item.validityDate}}</div>
                    </div>
                    <div class="list_money">
                        <span class="a">￥</span>
                        <span class="mon">{{item.discounted}}</span>
                    </div>
                </div>

            </div>
            <div class="list_title">
                <span>限登录和收餐手机号{{mobile}}使用</span>
            </div>
        </div>
    </div>

</template>

<script>
export default {
	data() {
		return {
			mobile: '',
			list: '',
		}
	},
	onLoad() {
		this.mobile = wx.getStorageSync('userPhone')
		this.getLuckList()
	},
	methods: {

		//获取优惠券列表
		getLuckList() {
			var userId = wx.getStorageSync('userId')
			let getParams = {
				url: '/miniprogramOrder/getLuck',
				method: 'post',
				data: {
					userId: userId,
				},
			}
			this.$JZWX(getParams).then(re => {
				console.log('asdasdas', re)
				this.list = re.data.list
			})
		},
	},
}
</script>

<style lang="scss" scoped>
.container {
	width: 100%;

	&:nth-child(1) {
		margin-top: 2px;
	}
	.list {
		width: 95%;
		margin: auto;
		background: #fff;
		height: 186rpx;
		border-radius: 20rpx;
		margin-top: 20rpx;

		.list_s {
			height: 70px;

			.list_container {
				display: flex;
				justify-content: space-between;
				align-items: center;
				height: 100%;
				border-bottom: 1px dashed #f3f3f3;
				.list_c {
					padding: 23rpx;
					.list_name {
						color: red;
						font-size: 30rpx;
						font-family: '楷体';
					}
					.list_time {
						font-size: 20rpx;
						color: #cccccc;
					}
				}
				.list_money {
					padding-right: 10rpx;
					.a {
						font-size: 25rpx;
						color: red;
					}
					.mon {
						font-size: 30rpx;
						color: red;
					}
				}
			}
		}
		.list_title {
			font-size: 20rpx;
			font-family: '楷体';
			line-height: 28px;
			span {
				padding: 20rpx;
				color: #a2a2a2;
			}
		}
	}
}
</style>

